package demoenum;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

/**
 * @Author 12629
 * @Description：
 */
public class Test {

    public static void main(String[] args) {
        try {
            Class<?> c = Class.forName("demoenum.TestEnum");

            Constructor<?> constructor =
                    c.getDeclaredConstructor(String.class,int.class,int.class,String.class);

            constructor.setAccessible(true);

            TestEnum testEnum = (TestEnum)constructor.newInstance("fasdfa",1,5,"橙色");

            System.out.println(testEnum);

        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
